package com.mao.service.product;

import java.io.OutputStream;
import java.util.List;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.mao.model.product.Product;
import com.mao.model.warehouse.WareHouse;
import com.mao.service.impl.product.ProductCondition;

@Transactional(rollbackFor=Exception.class,propagation=Propagation.REQUIRED)
public interface IProductService<T>{

	public Product saveProduct(Product pro);
	
	public Product updateProduct(Product pro);
	
	public List<Product> getAllProducts(ProductCondition productCondition,Integer page,Integer rows);
	
	public Product getProductById(long id);
	
	public int getAllProductCount(ProductCondition productCondition);
	
	public List<Product> getProductsByProClass(ProductCondition productCondition,Integer page,Integer rows);
	
	public Integer getProductsByProClassCount(ProductCondition productCondition);
	
	// 验证是否可以删除该商品
	public String valDelPro(long id);
	
	
	public void exportExcel(ProductCondition productCondition, OutputStream os);
	
	public List<Product> getAllProducts(ProductCondition productCondition);
	
	/**
	 * 
	 *  Created on 2012-11-27 
	 * <p>Discription:[获取所有的Product数据]</p>
	 * @author:[沈晓超]
	 * @update:[日期2012-11-27] [沈晓超]
	 * @return
	 * @return List<Product>
	 */
	public List<Product> getAllProducts();
	
	/**
	 * 根据商品ID和初始仓库的仓库获取商品
	 * @return
	 */
	public Product getProductByInitAndProId(Long proId,WareHouse warehouse);
}
